<!DOCTYPE html>
<html lang="en">
<head>
    <title>流程设计</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <link rel="stylesheet" href="/static/lib/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/lib/layuiadmin/style/admin.css" media="all">

    <link type="text/css" rel="stylesheet" href="../../../../common/lib/font-awesome/css/font-awesome.min.css"/>
    <link type="text/css" rel="stylesheet" href="../../../../common/css/formsyle.css"/>
    <link type="text/css" rel="stylesheet" href="../../../../common/css/formDetail.css"/>
    <link type="text/css" rel="stylesheet" href="../../../../common/lib/jsPlumb/jsplumbtoolkit-defaults.css"/>

    <link type="text/css" rel="stylesheet" href="../../../../base/workFlow/workFlow/workflowDesigner.css" media="all">

    <style>
        .layui-table-view{
            border: 1px solid #f2f2f2;
        }
        .layui-table-box{
            height: 100%;
        }
    </style>
</head>
<body style="margin:0;padding:0px;border:0;width:100%;height:100%;">
<div class="mini-toolbar">
    <a href="javascript:;" id="addSimpleActivityBtn" class="layui-btn layui-btn-sm" onclick="createActivity('simple')">
        <i class="layui-icon" aria-hidden="true">&#xe654;</i>&nbsp;新建活动</a>

    <a href="javascript:;" id="addEndActivityBtn" class="layui-btn layui-btn-sm" onclick="createActivity('end')">
        <i class="layui-icon" aria-hidden="true">&#xe654;</i>&nbsp;新建结束</a>

    <!--<span style="float:right;">
        <a id="btnShowForm" class="layui-btn layui-btn-sm" onclick="layer.alert('show form');">查看表单</a>
    </span>-->

</div>

<div id="main">
    <div class="flowchart" id="flowchart"></div>
</div>
<!--活动-->
<div id="nodeDetail" style="display: none; padding: 10px 0px 0px 10px; line-height: 40px">
    <input type="hidden" id="arrAuths" value="[]"/>

    <div class="layui-tab-item layui-show" id="tab1content" style="height: 430px">
        <form class="layui-form" lay-filter="nodeForm" style="width: 100%;">
            <div class="layui-form-item">
                <label class="layui-form-label">活动名</label>
                <div class="layui-input-block" style="width: 70%">
                    <input type="text" id="node_Name" name="node_Name" class="layui-input" style="width: 560px"/>
                </div>
            </div>

            <div class="layui-form-item participatetype">
                <label class="layui-form-label">参与类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="participateType" lay-filter="participateType" value="1" title="单人">
                    <input type="radio" name="participateType" lay-filter="participateType" value="2" title="多人">
                </div>
            </div>

            <!--审批结果发送人-->
            <div class="layui-form-item notifyPerson" style="display: none;">
                <label class="layui-form-label">结果送达人员</label>
                <div class="layui-input-block">
                    <input type="radio" name="notifyPerson" lay-filter="notifyPerson" value="1" title="申请人" checked>
                    <input type="radio" name="notifyPerson" lay-filter="notifyPerson" value="2" title="全部参与人员">
                </div>
            </div>

            <div class="layui-form-item endHide view001">
                <label class="layui-form-label" style="margin-top: 3px">操作类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="operationType" lay-filter="operationType" value="1" title="串行">
                    <input type="radio" name="operationType" lay-filter="operationType" value="2" title="并行">
                    <input type="radio" name="operationType" lay-filter="operationType" value="4" title="协作">
                    <input type="radio" name="operationType" lay-filter="operationType" value="3" title="抢占">
                </div>
            </div>

            <div class="layui-form-item endHide view001 view002">
                <label class="layui-form-label" style="margin-top: 4px">节点按钮</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="btnType10" lay-filter="btnType" value="10" title="提交"  class="layui-btn layui-btn-normal">
                    <input type="checkbox" name="btnType20" lay-filter="btnType" value="20" title="保存" class="layui-btn layui-btn-normal">
                    <input type="checkbox" name="btnType30" lay-filter="btnType" value="30" title="退回">
                    <input type="checkbox" name="btnType40" lay-filter="btnType" value="40" title="跳转" class="layui-btn layui-btn-normal">
                    <input type="checkbox" name="btnType50" lay-filter="btnType" value="50" title="撤销" class="layui-btn layui-btn-normal view001">
                </div>
            </div>
        </form>
        <!--参与者类型-->
        <div class="layui-form-item endHide" style="width: 85%;padding:5px 0px 0px 50px">
            <table id="tableAuth" lay-filter="tableAuth">
                <thead>
                <tr>
                    <th lay-data="{field:'authType',width:'121',align:'center'}">参与者类型</th>
                    <th lay-data="{field:'name',width:'364',align:'center'}">参与者</th>
                    <th lay-data="{field:'btnMove',width:'123',fixed:'right',align:'center',toolbar:'#btnMove'}">增加按钮
                    </th>
                </tr>
                </thead>
            </table>
        </div>

    </div>
    <!--活动数据保存-->
    <div style="text-align: right;padding: 36px 60px 0px 0px">
        <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="deleteActivity();" style="margin-right: 10px">
            <i class="layui-icon">&#xe642;</i> 删除
        </button>

        <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="saveNode();" style="margin-right: 10px">
            <i class="layui-icon">&#xe642;</i> 保存
        </button>

        <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="closeLayer();">
            <i class="layui-icon">&#xe642;</i> 关闭
        </button>
    </div>
</div>

<!--活动连接线-->
<div id="lineDetail" style="display: none; padding: 20px 0px 0px 20px; line-height: 40px">
    <div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起始节点</label>
                <div class="layui-input-inline">
                    <input type="text" id="previousNode" name="previousNode" class="layui-input"
                           readonly="readonly">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">目标节点</label>
                <div class="layui-input-inline">
                    <input type="text" id="nextNode" class="layui-input" readonly="readonly">
                </div>
            </div>
        </div>
    </div>

    <div class="layui-form layui-form-item">
        <label class="layui-form-label">控制条件</label>
        <div class="layui-input-inline" style="width: 150px">
            <select id="conditionKey" name="conditionKey" lay-filter="conditionKey">

            </select>
        </div>
        <div class="layui-input-inline" style="width: 110px">
            <select id="oprator" lay-filter="oprator">
                <option value="">选择关系</option>
                <option id="o11" value="o11">＝</option>
                <option id="o22" value="o22">!＝</option>
                <option id="o21" value="o21">＞</option>
                <option id="o212" value="o212">＞＝</option>
                <option id="o12" value="o12">＜</option>
                <option id="o121" value="o121">＜＝</option>
            </select>
        </div>
        <div class="layui-input-inline" style="width: 150px">
            <div id="conditionKeyValue_div">
                <select id="conditionKeyValue" name="conditionKeyValue" lay-filter="conditionKeyValue">
                    <option value="">选择控制值</option>
                </select>
            </div>
            <input type="text" id="conditionKeyValueText" placeholder="输入控制值" class="layui-input" style="display: none">

        </div>
        <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="addConditon();"
                style="margin-top: 5px">
            <i class="layui-icon">&#xe654;</i> 增加
        </button>
    </div>

    <div style="margin-left: 30px;">
        <div class="layui-inline">
            <table id="formField" lay-filter="formField" style="width: 100%;">
                <thead>
                <tr>
                    <th lay-data="{field:'rowIndex',hide:'true'}"></th>
                    <th lay-data="{field:'fieldName',hide:'true'}"></th>
                    <th lay-data="{field:'operator',hide:'true'}"></th>
                    <th lay-data="{field:'conValue',hide:'true'}"></th>
                    <th lay-data="{field:'fieldDisName',width:'200',fixed:'left',align:'center'}">控制条件</th>
                    <th lay-data="{field:'operatorName',width:'100',align:'center'}">关系</th>
                    <th lay-data="{field:'conValueName',width:'200',align:'center'}">控制值</th>
                    <th lay-data="{field:'btnDel',width:'100',align:'center'}">操作</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>

    <div class="layui-card">
        <div class="layui-card-header"></div>
    </div>

    <div style="text-align: right; padding-right: 50px; margin-top: 20px">

        <button class="layui-btn layui-btn-normal" onclick="deleteNextActivity();" style="margin-right: 10px">
            <i class="layui-icon">&#xe640;</i> 删除
        </button>

        <button class="layui-btn layui-btn-normal" onclick="saveCons();" style="margin-right: 10px">
            <i class="layui-icon">&#xe642;</i> 保存
        </button>

        <button class="layui-btn layui-btn-normal" onclick="closeLayer();">
            <i class="layui-icon">&#x1006;</i> 关闭
        </button>
    </div>
</div>



<div id="userOrder" style="display: none">
    <table id="tableUsers" lay-filter="tableUsers" style="width: 100%;">
        <thead>
        <tr>
            <th lay-data="{field:'userId',hide:'true'}"></th>
            <th lay-data="{field:'rowIndex',width:'20%',fixed:'left',type:'numbers'}">办理顺序</th>
            <th lay-data="{field:'userName',width:'35%',align:'center'}">用户姓名</th>
            <th lay-data="{field:'btnDel',width:'45%',align:'center',toolbar:'#btns'}">操作</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/html" id="btns">
    <button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="moveUp">
        <i class="layui-icon">&#xe619;</i>
    </button>

    <button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="moveDown">
        <i class="layui-icon">&#xe61a;</i>
    </button>
</script>

<script type="text/html" id="btnMove">
    <button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="removeAuth">
        <i class="layui-icon">&#x1006;</i>移除
    </button>
</script>

</body>

<script type="text/javascript" src="../../../../common/lib/jquery-1.12.4.min.js"></script>

<script type="text/javascript" src="../../../../common/jquery.serializejson.min.js"></script>
<script type="text/javascript" src="../../../../common/common.js"></script>
<script type="text/javascript" src="../../../../common/lib/jquery-ui-1.9.2-min.js"></script>
<script type="text/javascript" src="../../../../common/lib/jsPlumb/jsplumb-2.8.6.min.js"></script>

<script src="/static/lib/layuiadmin/layui/layui.js" type="text/javascript"></script>
<script src="/static/lib/layuiadmin/layui/layui.all.js" type="text/javascript"></script>
<script src="../../../../common/dataGrid.js"></script>

<script type="text/javascript">
    mini_debugger = true;
    layui.config({
        base: '../../../../layuiadmin/'
    }).extend({
        treeSelect: 'modules/treeSelect',
        formSelects: 'formSelects-v4',
        tableSelect: 'tableSelect'
    })
</script>

<script type="text/javascript" src="flowchartBoot.js"></script>
<script type="text/javascript" src="nextActivity.js"></script>
<script type="text/javascript" src="workflowDesigner.js"></script>
<script type="text/javascript" src="activityEdit.js"></script>
</html>